const cart = {
    namespaced: true,

    state: () => ({
        goodsList: ['vue', 'node', 'webpack']
    }),

    mutations: {
        addGoods (state) {
            state.goodsList.push('vue3')
        }
    },
    getters: {
        mapGoodsList (state) {
            return state.goodsList.map((item) => item + '!!!')


        }

    },
    actions: {
        asyncAddGoods (context) {
            setTimeout(() => {
                context.commit('addGoods')
            }, 2000)
        }
    }


}


export default cart